package com.ysd.lis.controller.inv;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.inv.InvOrderInfo;
import com.ysd.lis.request.inv.*;
import com.ysd.lis.service.inv.InvOrderInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 订单信息 前端控制器
 * </p>
 *
 * @author WH
 * @since 2024-09-19
 */
@RestController
@RequestMapping("/inv/orderInfo")
public class InvOrderInfoController extends BaseController {

    @Autowired
    InvOrderInfoService invOrderInfoService;

    @ApiOperation("查询")
    @GetMapping("/findOrderInfoList")
    public Result findOrderInfoList(InvOrderParam param) {
        return invOrderInfoService.findOrderInfoList(param);
    }

    @ApiOperation("调拨入库/出库查询")
    @GetMapping("/findOrderInfoListByAllot")
    public Result findOrderInfoListByAllot(InvOrderParam param) {
        return invOrderInfoService.findOrderInfoListByAllot(param);
    }

    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteInvOrderInfoList")
    public Result batchDeleteInvOrderInfoList(@RequestBody InvOrderDto dto) {
        return invOrderInfoService.batchDeleteInvOrderInfoList(dto);
    }

    @ApiOperation("新增")
    @PostMapping("/addOrderInfo")
    public Result addOrderInfo(@RequestBody InvOrderInfo invOrderInfo) {
        return invOrderInfoService.addOrderInfo(invOrderInfo);
    }

    @ApiOperation("出库验收确认")
    @PostMapping("/checkOutStock")
    public Result checkOutStock(@RequestBody InvOrderInfo invOrderInfo) {
        return invOrderInfoService.checkOutStock(invOrderInfo);
    }

    @ApiOperation("编辑")
    @PostMapping("/editOrderInfo")
    public Result editOrderInfo(@RequestBody InvOrderInfo invOrderInfo) {
        return invOrderInfoService.editOrderInfo(invOrderInfo);
    }

    @ApiOperation("查询订单及详情")
    @GetMapping("/findOrderInfoAndReagent")
    public Result findOrderInfoAndReagent(InvOrderParam param) {
        return invOrderInfoService.findOrderInfoAndReagent(param);
    }

    @ApiOperation("查询订单及详情(调拨入库)")
    @GetMapping("/findOrderInfoByAllot")
    public Result findOrderInfoByAllot(InvOrderParam param) {
        return invOrderInfoService.findOrderInfoByAllot(param);
    }

    @ApiOperation("验收入库")
    @PostMapping("/batchCheckInStock")
    public Result batchCheckInStock(@RequestBody InvOrderDto dto) {
        return invOrderInfoService.batchCheckInStock(dto);
    }

    @ApiOperation("调拨入库/出库验收")
    @PostMapping("/batchAllotInStock")
    public Result batchAllotInStock(@RequestBody InvOrderDto dto) {
        return invOrderInfoService.batchAllotInStock(dto);
    }

    @ApiOperation("财务验收")
    @PostMapping("/orderFinanceCheck")
    public Result orderFinanceCheck(@RequestBody InvOrderDto dto) {
        return invOrderInfoService.orderFinanceCheck(dto);
    }

    @GetMapping("/getInvOrderAgency")
    public Result getInvOrderAgency(InvReagentStockParam param) {
        return invOrderInfoService.getInvOrderAgency(param);
    }

    /*单个商品流程步骤*/
    @GetMapping("/getReagentSteps")
    public Result getReagentSteps(GetReagentStepsParam input) {
        return invOrderInfoService.getReagentSteps(input);
    }

    /*批次查询Chart图*/
    @GetMapping("/getBatchSearchChart")
    public Result getBatchSearchChart(FindReagentStockByBatchParam input) {
        return invOrderInfoService.getBatchSearchChart(input);
    }

}
